﻿<?php defined('ByShopWWI') or exit('Access Invalid!');?>
<script>var PURL = '<?php echo $output['purl'];?>';$(document).ready(function(){ $('#area_info').nc_region();});</script>
<link href="<?php echo SHOP_TEMPLATES_URL;?>/css/store_list.css" rel="stylesheet" type="text/css">
<link href="<?php echo SHOP_TEMPLATES_URL;?>/css/wwi-main.css" rel="stylesheet" type="text/css">
<link href="<?php echo RESOURCE_SITE_URL;?>/js/jcarousel/skins/tango/skin.css" rel="stylesheet" type="text/css">
<div class="content">
<div class="sort-bar">
  <div class="shop_con_list" id="main-nav-holder">
    <nav class="nc-gl-sort-bar" id="main-nav">
      <form id="store_list" method="GET" action="index.php">
        <input type="hidden" name="order" value="<?php echo $_GET['order'];?>"/>
        <input type="hidden" name="act" value="store_list"/>
        <input type="hidden" name="cate_id" value="<?php echo $_GET['cate_id'];?>"/>
        <div class="nc-store-class">
  <?php if(!empty($output['class_list']) && is_array($output['class_list'])){?>
  <dl class="clearfix">
    <dt>店铺类目<?php echo $lang['nc_colon'];?></dt>
    <dd>
      <a href="<?php echo urlShop('store_list','index');?>">全部</a>
      <?php foreach($output['class_list'] as $k=>$v){?>
	      <?php if ($_GET['cate_id'] == $v['sc_parent_id']){?>
	      <a href="<?php echo urlShop('store_list','index',array('cate_id'=>$k));?>"><?php echo $v['sc_name'];?></a>
	      <?php }elseif (!isset($v['child']) && $output['class_list'][$_GET['cate_id']]['sc_parent_id'] == $v['sc_parent_id']){?>
	      <a href="<?php echo urlShop('store_list','index',array('cate_id'=>$k));?>"><?php echo $v['sc_name'];?></a>
	      <?php }?>
      <?php }?>
    </dd>
  </dl>
  <?php }?> 
  <?php if (!C('fullindexer.open')){?>
  <dl class="clearfix">
            <dt>店铺名称<?php echo $lang['nc_colon'];?></dt>
            <dd>
            <div class="selectbox">
              <input class="text" type="text" name="keyword" value="<?php echo $_GET['keyword'];?>"/>
            </div>
            <div class="selectbox" style=" margin-left:20px;"><label for="area_info">店铺所在地<?php echo $lang['nc_colon'];?></label></div><div class="selectbox"><input id="area_info" name="area_info" type="hidden" value=""/></div>
            <div class="sidebox" style="">
            <div class="selectbox">
              <input class="btn" type="submit" value="<?php echo $lang['nc_search'];?>" />
            </div>
          </div></dd>
          </dl>
           
          <?php }?>
</div>
        <div class="sort-bar"><!-- 排序方式S -->
          <ul class="array">
          <!-- 默认 -->
            <li <?php if(!$_GET['key']){?>class="selected"<?php }?>><a href="javascript:void(0)" class="nobg" onClick="javascript:ss_dropParam('key','order');" title="<?php echo $lang['goods_class_index_default_sort'];?>">默认</a></li>
            <!-- 销量 -->
            <li <?php if($_GET['key'] == 'store_sales'){?>class="selected"<?php }?>><a href="javascript:void(0)" <?php if($_GET['key'] == 'store_sales'){?>class="<?php echo $_GET['order'];?>"<?php }?> onClick="javascript:ss_replaceParam('store_sales','<?php echo ($_GET['order'] == 'desc' && $_GET['key'] == 'store_sales')?'asc':'desc' ?>');" title="<?php echo ($_GET['order'] == 'desc' && $_GET['key'] == 'store_sales')?$lang['store_class_index_sold_asc']:$lang['store_class_index_sold_desc']; ?>">销量</a></li>
            <!-- 信用 -->
            <li <?php if($_GET['key'] == 'store_credit'){?>class="selected"<?php }?>><a href="javascript:void(0)" <?php if($_GET['key'] == 'store_credit'){?>class="<?php echo $_GET['order'];?>"<?php }?> onClick="javascript:ss_replaceParam('store_credit','<?php  echo ($_GET['order'] == 'desc' && $_GET['key'] == 'store_credit')?'asc':'desc' ?>');" title="<?php  echo ($_GET['order'] == 'desc' && $_GET['key'] == 'store_credit')?$lang['store_class_index_credit_asc']:$lang['store_class_index_credit_desc']; ?>">信用</a></li>
            <!-- <li><a href="javascript:void(0)" class="more-on" attr='morep' nc_type='all'>切换为小图</dd></a></li>-->
          </ul>
          <!-- 排序方式E -->
         
        </div>
      </form>
    </nav>
  </div>
</div>

<ul class="nc-store-list">
<?php if(!empty($output['store_list']) && is_array($output['store_list'])){?>
<?php foreach($output['store_list'] as $skey => $store){?>
<!--判断无货品的店铺不显示--><?php /**if(!empty($store['search_list_goods'])){*/?>
<!--判断不显示默认店铺--><?php if($store['grade_id'] != 1){?>
    <li class="item clearfix">
    <div class="wwi-store-left">
      <dl class="shop-info"> 
        <dd class="shop-pic">
        <!--去掉链接 <a href="<?php echo urlShop('show_store','', array('store_id'=>$store['store_id']),$store['store_domain']);?>" title="" target="_blank">--><span class="storelogo"><img src="<?php echo getStoreLogo($store['store_label']);?>"  alt="<?php echo $store['store_name'];?>" title="<?php echo $store['store_name'];?>" class="storelogo" /></span><!-- </a>-->
        </dd>
        <dd class="shopkeeper" style="font-size:16px"><a href="<?php echo urlShop('show_store','', array('store_id'=>$store['store_id']),$store['store_domain']);?>" target="_blank">【<?php echo $store['store_name'];?>】</a><span>
        <?php if(!empty($store['store_qq'])){?>
          <a target="_blank" href="http://wpa.qq.com/msgrd?v=3&uin=<?php echo $store['store_qq'];?>&site=qq&menu=yes" title="QQ: <?php echo $store['store_qq'];?>"><img border="0" src="http://wpa.qq.com/pa?p=2:<?php echo $store['store_qq'];?>:52" style=" vertical-align: middle;"/></a>
        <?php }?>
        <?php if(!empty($store['store_ww'])){?>
          <a target="_blank" href="http://amos.im.alisoft.com/msg.aw?v=2&uid=<?php echo $store['store_ww'];?>&site=cntaobao&s=2&charset=<?php echo CHARSET;?>" ><img border="0" src="http://amos.im.alisoft.com/online.aw?v=2&uid=<?php echo $store['store_ww'];?>&site=cntaobao&s=2&charset=<?php echo CHARSET;?>" alt="Wang Wang" style=" vertical-align: middle;" /></a>
        <?php }?></span>
        </dd>
        
        <dd class="main-runs" title="<?php echo $store['store_zy']?>">
		<em style="font-weight:700; color:#333">主营：</em><?php echo $store['store_zy']?>
        </dd>
        
        <dd class="main-runs1" title="<?php echo $store['store_phone']?>">
		<em style="font-weight:700; color:#333">地址：</em><?php echo $store['store_address']?>
        </dd>
        <dd class="main-runs1" title="<?php echo $store['store_phone']?>">
		<em style="font-weight:700; color:#333">电话：</em><?php echo $store['store_phone']?>
        </dd>
      </dl>



     </div>


<!--店铺商品展示   
      <div class="nc-shop-goodslist" nc_type='goods_all'> 
	  <?php if(!empty($store['search_list_goods']) && is_array($store['search_list_goods'])){?>
        <div class="arrow"></div>
        <ul class="jcarousel-skin-tango" nc_type="jcarousel" >
        <?php foreach($store['search_list_goods'] as $k=>$v){?>
        <li>
            <dl>
              <dt class="goods-pic"><span class="thumb size160"> <i></i> <a href="index.php?act=goods&goods_id=<?php echo $v['goods_id'];?>" target="_blank"> <img  onload="javascript:DrawImage(this,160,160);" alt="<?php echo $v['goods_name'];?>" src="<?php echo thumb($v,'small');?>"></a></span></dt>
              <dd class="goods-name"><a href="<?php echo urlShop('goods','',array('goods_id'=>$v['goods_id']));?>" title="<?php echo $v['goods_name'];?>" target="_blank"><?php echo $v['goods_name'];?></a></dd>
              <dd class="goods-price"><em><?php echo $v['goods_store_price'];?></em></dd>
              <dd class="goods-sales"><?php echo $lang['store_class_index_deal'];?><em><?php echo $v['goods_salenum'];?></em><?php echo $lang['store_class_index_jian'];?></dd>
            </dl>
          </li>
         <?php }?>
        </ul> <?php }else{?><ul class="jcarousel-skin-tango" nc_type="jcarousel" ><li>该店主很懒！还没上传产品</li></ul><?php }?>
      </div> -->  
<?php }?>
    </li>
<?php   } ?><!--end-->

<?php }else{?>
<div id="no_results"><?php echo $lang['store_class_index_no_record'];?></div>
<?php }?>

</ul>


<div class="pagination"> <?php echo $output['show_page'];?> </div>
</div>
<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL;?>/js/waypoints.js"></script> 
<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL;?>/js/jcarousel/jquery.jcarousel.min.js"></script> 

<script type="text/javascript">
$(function(){
	//图片轮换
    $('[nc_type="jcarousel"]').jcarousel({visible: 4});
    $('[attr="morep"]').click(function(){
    	var id = $(this).attr('nc_type');
    	if($(this).attr('class')=='more-off'){
    		$(this).addClass('more-on').removeClass('more-off').html('切换为小图<i></i>');
    		$('div[nc_type="goods_all"]').show();
    	}else{
    		$(this).addClass('more-off').removeClass('more-on').html('切换为大图<i></i>');
    		$('div[nc_type="goods_all"]').hide();
    	}
    });
   
});
</script>
